#include "stdafx.h"
#include "net/HTTPServerParams.hpp"

NET_NAMESPACE_BEGIN

CHTTPServerParams::CHTTPServerParams()
	: m_timeout(60000000),
	m_keepAlive(true),
	m_maxKeepAliveRequests(0),
	m_keepAliveTimeout(15000000)
{
}

CHTTPServerParams::~CHTTPServerParams()
{
}

void CHTTPServerParams::setServerName(const std::string& serverName)
{
	m_serverName = serverName;
}

const std::string& CHTTPServerParams::getServerName() const
{
	return m_serverName;
}

void CHTTPServerParams::setSoftwareVersion(const std::string& softwareVersion)
{
	m_softwareVersion = softwareVersion;
}

const std::string& CHTTPServerParams::getSoftwareVersion() const
{
	return m_softwareVersion;
}

void CHTTPServerParams::setTimeout(const CTimeSpan& timeout)
{
	m_timeout = timeout;
}

const CTimeSpan& CHTTPServerParams::getTimeout() const
{
	return m_timeout;
}

void CHTTPServerParams::setKeepAlive(bool keepAlive)
{
	m_keepAlive = keepAlive;
}

bool CHTTPServerParams::getKeepAlive() const
{
	return m_keepAlive;
}

void CHTTPServerParams::setKeepAliveTimeout(const CTimeSpan& timeout)
{
	m_keepAliveTimeout = timeout;
}

const CTimeSpan& CHTTPServerParams::getKeepAliveTimeout() const
{
	return m_keepAliveTimeout;
}

void CHTTPServerParams::setMaxKeepAliveRequests(int maxKeepAliveRequests)
{
	jh_assert (maxKeepAliveRequests >= 0);
	m_maxKeepAliveRequests = maxKeepAliveRequests;
}

int CHTTPServerParams::getMaxKeepAliveRequests() const
{
	return m_maxKeepAliveRequests;
}

NET_NAMESPACE_END
